package top.wilbert.collegelink.user.controller;

import java.util.Arrays;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import top.wilbert.collegelink.user.entity.CompanyCertificationEntity;
import top.wilbert.collegelink.user.service.CompanyCertificationService;
import top.wilbert.collegelink.common.utils.PageUtils;
import top.wilbert.collegelink.common.utils.R;



/**
 * 
 *
 * @author Augus
 * @email 2531496343@qq.com
 * @date 2023-03-20 21:50:59
 */
@RestController
@RequestMapping("user/companycertification")
public class CompanyCertificationController {
    @Autowired
    private CompanyCertificationService companyCertificationService;





    /**
     * 列表
     */
    @RequestMapping("/list")
   // @RequiresPermissions("user:companycertification:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = companyCertificationService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{certificationId}")
   // @RequiresPermissions("user:companycertification:info")
    public R info(@PathVariable("certificationId") Long certificationId){
		CompanyCertificationEntity companyCertification = companyCertificationService.getById(certificationId);

        return R.ok().put("companyCertification", companyCertification);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
   // @RequiresPermissions("user:companycertification:save")
    public R save(@RequestBody CompanyCertificationEntity companyCertification){
		companyCertificationService.save(companyCertification);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
   // @RequiresPermissions("user:companycertification:update")
    public R update(@RequestBody CompanyCertificationEntity companyCertification){
		companyCertificationService.updateById(companyCertification);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
   // @RequiresPermissions("user:companycertification:delete")
    public R delete(@RequestBody Long[] certificationIds){
		companyCertificationService.removeByIds(Arrays.asList(certificationIds));

        return R.ok();
    }

}
